package spring.aop.aspect;


import org.aspectj.lang.ProceedingJoinPoint;

public class AspectCase {
    public void before() {
        System.out.println("xueAspect.before");
    }

    public void afterReturning() {
        System.out.println("xueAspect.afterReturning");
    }

    public void afterThrowing() {
        System.out.println("xueAspect.afterThrowing");
    }

    public void after() {
        System.out.println("xueAspect.after");
    }

    public Object aroundinit(ProceedingJoinPoint pjp, String bizName, int times) {
        System.out.println(bizName + "  " + times);
        Object obj = null;
        System.out.println("aroundInit 1");
        try {
            obj = pjp.proceed();
        } catch (Throwable e) {
            e.printStackTrace();
        }
        System.out.println("aroundInit 2");
        return obj;


    }

    public Object around(ProceedingJoinPoint pjp) {
        Object obj = null;
        System.out.println("around 1");
        try {
            obj = pjp.proceed();
        } catch (Throwable e) {
            e.printStackTrace();
        }
        System.out.println("around 2");
        return obj;
    }
}
